{% extends "BackendBundle::backend.html.twig" %}

{% block title "Administración idiomas" %}

{% block header %}

    {% set vars = {'ruta' : app.request.attributes.get('_route')} %}
    {% include "BackendBundle::topmenu.html.twig" with vars %}

{% endblock %}

{% block left %}



{% endblock %}

{% block content %}

    <div class="span12">
        
        <h2>{{ "Administracion de Idiomas"|trans }}</h2>
        
        <p>&nbsp;</p>
        
        {% if app.session.hasFlash('success') %}
            <div class="flash-notice alert alert-success">
                <h4 class="alert-heading">Ok!</h4>                     
                {{ app.session.flash('success') }}
            </div>
        {% endif %}

        {% if app.session.hasFlash('error') %}
            <div class="flash-notice alert alert-error">
                <h4 class="alert-heading">Error!</h4>                        
                {{ app.session.flash('error') }}
            </div>
        {% endif %}

        {% if app.session.hasFlash('info') %}
            <div class="flash-notice alert alert-info">
                <h4 class="alert-heading">Info!</h4>
                <p>{{ app.session.flash('info') }}</p>
            </div>
        {% endif %}
        
               
        {% for hotel in hotelspublicats %}

            <h2>{{hotel.hotelname}}</h2>
            
            <div class="well">
                 
                {% for language in languages %}

                    
                    <div class="span2">     
                        {% for hotelIdiomes in hotelsIdiomes %}            

                            {% if hotelIdiomes.idhotel == hotel.id and hotelIdiomes.ididioma == language.id %}

                                {% if hotelIdiomes.published == 1 %}

                                    {% image '@IdiomasBundle/Resources/public/images/publicat.png' %}
                                        <a href="{{ path("IdiomasBundle_publish", {'idlinea': hotelIdiomes.id}) }}"><img src="{{ asset_url }}" /></a>
                                    {% endimage %}

                                {% else %}

                                    {% image '@IdiomasBundle/Resources/public/images/no-publicat.png' %}
                                        <a href="{{ path("IdiomasBundle_publish", {'idlinea': hotelIdiomes.id}) }}"><img src="{{ asset_url }}" /></a>
                                    {% endimage %}

                                {% endif %}

                            {% endif %}
                        {% endfor %}
                                            
                        {{language.idioma}}
                    </div>
                    
                
                {% endfor %}
                    
            </div>
            <br />
            
        {% endfor %}
        
    </div>

{% endblock %}



